package com.youle.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.springframework.http.HttpStatus;

/**
 * Created by
 *  一些常见的异常的枚举类
 * @author touni
 * @date 2019/4/18
 * @time 12:33
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum  ExceptionEnum {

    PRICE_NOT_BE_NULL(HttpStatus.BAD_REQUEST.value(),"价格不能为空"),
    CATEGORY_NOT_FOUND(HttpStatus.NO_CONTENT.value(),"分类没有查询到"),
    PARAM_NOT_BE_NULL(HttpStatus.BAD_REQUEST.value(),"参数补全，请填完整！！"),
    INSERT_CATEGORY_FAIL(HttpStatus.INTERNAL_SERVER_ERROR.value(),"插入类目失败"),
    DELETE_CATEGORY_FAIL(HttpStatus.INTERNAL_SERVER_ERROR.value(),"删除类目失败"),
    DELETE_CATEGORY_FAIL_HAVESONNODE(HttpStatus.INTERNAL_SERVER_ERROR.value(),"有子节点无法删除"),
    EDIT_CATEGORY_FAIL(HttpStatus.INTERNAL_SERVER_ERROR.value(),"修改类目失败"),
    INSERT_BRAND_FAIL(HttpStatus.INTERNAL_SERVER_ERROR.value(),"增加品牌失败"),
    INSERT_CATEGORYBRAND_FAIL(HttpStatus.INTERNAL_SERVER_ERROR.value(),"新增品牌插入到中间表categorybrand失败"),
    UPLOAD_PARA_ERROR(HttpStatus.BAD_REQUEST.value(),"不支持的文件类型或者文件为空"),
    NOT_FOUND(HttpStatus.NO_CONTENT.value(),"未查询到!!!"),
    UPDATE_BRAND_FAIL(HttpStatus.INTERNAL_SERVER_ERROR.value(),"更新brand表失败"),
    DELETE_BRAND_FAIL(HttpStatus.INTERNAL_SERVER_ERROR.value(),"删除brand表失败"),
    DELETE_CATEGORYBRAND_FAIL(HttpStatus.INTERNAL_SERVER_ERROR.value(),"删除categorybrand表失败"),
    NO_SPU_ITEM(HttpStatus.CREATED.value(),"目前暂时没有商品"),

    ;
    private int code;
    private String msg;


}
